package com.example.qxfw.nyqx.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.example.qxfw.common.entity.ny.QhCropIndex;
import com.example.qxfw.nyqx.mapper.QhCropIndexMapper;
import com.example.qxfw.nyqx.service.QhCropIndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class QhCropIndexServiceImpl implements QhCropIndexService {

    @Autowired
    private QhCropIndexMapper qhCropIndexMapper;

    @Override
    public List<QhCropIndex> getList() {
        return qhCropIndexMapper.selectList(null);
    }

    @Override
    public List<QhCropIndex> getList1(String layerName, String analyseName) {
        LambdaQueryWrapper<QhCropIndex> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(QhCropIndex::getLayername,layerName)
                .eq(QhCropIndex::getAnalysename,analyseName);
        List<QhCropIndex> qhCropIndices = qhCropIndexMapper.selectList(queryWrapper);
        return qhCropIndices;
    }
}
